home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
GAMES
/
ANGBANDUEL
/
Dump2Sprt
/
!dmp2spr
/
!RunImage
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1996-03-26
|
10KB
|
460 lines
>!RunImage
taskname$="Dmp2Spr"
dirname$="<Dmp2Spr$dir>"
iconname$="!Dmp2Spr"
menuname$="Dmp2Spr"
filetype%=&FF9
painflag%=
os3%=
inquire%=
dieonsave%=
datamodified%=
throwback(
taskid% 8:$taskid%="TASK"
"Wimp_Initialise",200,!taskid%,taskname$
version%,taskhand%
block% 1024,ibm% 1024,winm% 1024,wblk% 2048
"Hourglass_On"
sprites
templates
initmenus
initwindows
iconid%=
"Hourglass_Off"
pollloop
pollloop
"Wimp_Poll",1,block%
reason%
reason%
2 :
"Wimp_OpenWindow",,block%
3 :
"Wimp_CloseWindow",,block%:
!block%=save%
saveclosed
9 :
menuclick(block%)
6 :
iconclicked(block%!12,block%!16)
8 :
keypressed(block%!24)
17,18:
7 :
keypressed(code%)
code%<>13
"Wimp_ProcessKey",code%:
"Wimp_GetCaretPosition",,wblk%
1" window%=!wblk%:icon%=wblk%!4
2. buttons%=4:
simulate select by default!
window%
4D
save% :
selected(save%,0,-1):
saveok:
selected(save%,0,0)
5$
"Wimp_ProcessKey",code%
nagg(nagg$)
"Wimp_ReportError"," "+nagg$,1<<4,taskname$
block%!0=-1
block%!4=0
block%!8=0 :
Y DIRECTION
A block%!12=76 :
X DIRECTION
block%!16=76
block%!20=&2002
$(block%+24)=iconname$
"Wimp_CreateIcon",,block%
icon%
=icon%
nagg("Error in death throes!"):
b%=1
(b%?fontarray%)>0
L
i%=1
(b%?fontarray%)
"Font_LoseFont",b%
N
"Wimp_CloseDown",taskhand%,!taskid%
click_type
c%=block%!8
c%=4
select
c%=2
popupmenu(
c%=1
adjust
block%!16
saveack
filedrop
loadack
dataopen
filedrop
block%!40=&FFF
checkload(
file(block%+44))
file(where%)
file$=""
?where%
file$+=
(?where%)
where%+=1
=file$
initmenus
r" i%=
initmenu(ibm%,menuname$)
s' i%=
additem(i%,"Info",0,inf_win%)
t" i%=
additem(i%,"Quit",-1,-1)
v# i%=
initmenu(winm%,menuname$)
w' i%=
additem(i%,"Info",0,inf_win%)
x" i%=
additem(i%,"Quit",-1,-1)
popupmenu(bar%)
inquire%
"Wimp_GetPointerInfo",,block%
~2q=!block%:w=block%!4:w%=block%!12:i%=block%!16
bar%
w=96+44*2
w+=22
bar%
menu%=ibm%
menu%=winm%
"Wimp_CreateMenu",,menu%,q-64,w
&lastmenu%=menu%:menx%=q-64:meny%=w
templates
fontarray% 256
b%=0
252
b%!fontarray%=0
infb% 540,infi% 200
autb% 1024,auti% 300
savb% 512,savi% 400
"Wimp_OpenTemplate",,dirname$+".templates"
:inf_win%=
template("info",infb%,infi%,200,-1,sprites%)
>aut_win%=
template("author_m",autb%,auti%,300,-1,sprites%)
7save%=
template("save",savb%,savi%,400,-1,sprites%)
"Wimp_CloseTemplate"
template(name$,buf%,ind%,len%,fonts%,sprs%)
"Wimp_LoadTemplate",,buf%,ind%,ind%+len%,fonts%,name$,0
buf%!64=sprs%
"Wimp_CreateWindow",,buf%
handle%
=handle%
sprites
sfile$="Sprites"+
suffix
file%=
(dirname$+"."+sfile$)
file%=0
nagg("Can't find spritefile!"):
#file%)+128
#file%
sprites% S%
sprites%!0=S%
sprites%!8=16
"OS_SpriteOp",9+256,sprites%
"OS_SpriteOp",10+256,sprites%,dirname$+"."+sfile$
select
adjust
openwindow(window%)
!wblk%=window%
"Wimp_GetWindowState",,wblk%
wblk%!28=-1
flags%=wblk%!32
(flags%
1<<16)=0
!wblk%=window%
"Wimp_GetWindowInfo",,wblk%
/ mwid%=
read_mode(-1,11)<<
read_mode(-1,4)
/ mhig%=
read_mode(-1,12)<<
read_mode(-1,5)
! width%=(wblk%!12)-(wblk%!4)
" height%=(wblk%!16)-(wblk%!8)
" wblk%!4=mwid%
2 - width%
wblk%!12=(wblk%!4)+width%
$ wblk%!8=mhig%
2 - height%
wblk%!16=wblk%!8+height%
wblk%!28=-1
"Wimp_OpenWindow",,wblk%
pii(window%,icon%,text$)
!wblk%=window%
wblk%!4=icon%
"Wimp_GetIconState",,wblk%
%ot$=$(wblk%!28):$(wblk%!28)=text$
wblk%!8=0
wblk%!12=0
ot$<>text$
"Wimp_SetIconState",,wblk%
contents(window%,icon%)
!wblk%=window%
wblk%!4=icon%
"Wimp_GetIconState",,wblk%
=$(wblk%!28)
closewindow(window%)
!wblk%=window%
"Wimp_CloseWindow",,wblk%
selected(window%,icon%,well%)
!wblk%=window%
wblk%!4=icon%
wblk%!12=1<<21
wblk%!8=(-well%)<<21
"Wimp_SetIconState",,wblk%
menuselection(blk%,menu%)
"Wimp_DecodeMenu",,menu%,blk%,wblk%+64
=$(wblk%+64)
menuclick(brtnd%)
, item$=
menuselection(brtnd%,lastmenu%)
PROCnagg(item$)
item$
"Quit" :
@
"Info" :
"Wimp_CreateMenu",,-1:
openwindow(aut_win%)
openwindowxy(window%,x%,y%)
!wblk%=window%
"Wimp_GetWindowState",,wblk%
!wblk%=window%
"Wimp_GetWindowInfo",,wblk%
! width%=(wblk%!12)-(wblk%!4)
hite%=(wblk%!16)-(wblk%!8)
wblk%!4=x%
wblk%!12=(wblk%!4)+width%
wblk%!16=y%
wblk%!8=(wblk%!16)-hite%
wblk%!28=-1
"Wimp_OpenWindow",,wblk%
saveclicked(xx%,yy%)
openwindowxy(save%,xx%,yy%)
initwindows
loadack
block%!12=block%!8
block%!16=4
"Wimp_SendMessage",19,block%,block%!4
saveack
name$=
file(block%+44)
leafname(name$)=""
NO FILE NAME!
block%!16=3
"Wimp_SendMessage",17,block%,block%!4
pii(save%,1,name$)
saveok
saveok
closewindow(save%)
"Wimp_CreateMenu",,-1
filename$=
contents(save%,1)
savefile(filename$)
dieonsave%
startdrag(window%,icon%)
solid%=
usedragasprite
block%!0=window%
"Wimp_GetWindowState",,block%
wx%=block%!4-block%!20
wy%=block%!16-block%!24
block%!4=icon%
"Wimp_GetIconState",,block%
block%!0=window%
block%!4=5
block%!8+=wx%
block%!12+=wy%
block%!16+=wx%
block%!20+=wy%-2
block%!24=0
block%!28=0
(6block%!32=(
read_mode(-1,11)+1)*2^
read_mode(-1,4)
)6block%!36=(
read_mode(-1,12)+1)*2^
read_mode(-1,5)
solid%
spr$="file_"+
~filetype%
"DragASprite_Start",%10001010,1,spr$,block%+8
soliddragon%=
"Wimp_DragBox",,block%
soliddragon%=
read_mode(mode%,var%)
"OS_ReadModeVariable",mode%,var%
,,value%
=value%
soliddragon%
"DragASprite_Stop"
"Wimp_GetPointerInfo",,block%
mx%=block%!0
my%=block%!4
window%=block%!12
window%<1
?'name$=
leafname(
contents(save%,1))
@#block%!0=44+((
name$
4)+1)*4
block%!16=1
block%!20=window%
block%!24=-1
block%!28=mx%
block%!32=my%
block%!36=&100
block%!40=filetype%
$(block%+44)=name$+
"Wimp_SendMessage",17,block%,window%
leafname(name$)
leaf$=""
name$<>""
name$,1)<>"."
leaf$=
name$,1)+leaf$
name$=
name$)
=leaf$
pad(num%)
" "+
(num%),4)
"OS_Module",20,0,-1
,,,name$,,,v%
Y,=(name$="UtilityModule"
v%>=&30000)<>0
usedragasprite
"OS_Byte",161,&1C
,,value%
=(value%
2)<>0
os3%
filedrag
startdrag(save%,2)
dataopen
checkload(name$)
loadfile(name$)
open(window%)
!wblk%=window%
"Wimp_GetWindowState",,wblk%
wblk%!28=-1
flags%=wblk%!32
=(flags%
1<<16)<>0
caretto(win%,icn%)
s l%=
contents(win%,icn%))
open(win%)
"Wimp_SetCaretPosition",win%,icn%,-1,-1,-1,l%
updatewindow(window%)
"Wimp_ForceRedraw",window%,0,-1E9,1E9,0
OS_ReadVarVal(A$)
"OS_ReadVarVal",A$,block%,128,0,3
,,L :A$=""
a= 0
A$=A$+
(block%!a)
iconclicked(window%,icon%)
buttons%=block%!8
window%<0
icon%=iconid%
click_type:
(block%!8)=2
window%=-2
popupmenu(icon%=iconid%):
window%
save% :
icon%
&
2 :
buttons%>=16
filedrag
0 :
saveok
.
3 :
closewindow(save%):dieonsave%=
aut_win% :
icon%=14
closewindow(aut_win%)
inf_win% :
icon%=2
"Wimp_CreateMenu",,-1:
openwindow(aut_win%)
initmenu(menu%,menuname$)
2$menu%=menuname$: :
menu title
Emenu%?12=7:menu%?13=2 :
title foreground & background
Emenu%?14=7:menu%?15=0 :
menu foreground & background
(menuname$)>5
" menu%!16=(
(menuname$)+1)*16
menu%!16=6*16
2menu%!20=44 :
width & height of items
@menu%!24=0 :
vertical gap twixt items
=menu%+28
additem(menu%,text$,last%,sub%)
last%
!menu%=128
!menu%=0
menu%!4=sub%
menu%!8=&7000021
$(menu%+12)=text$
=menu%+24
suffix
"OS_ReadModeVariable",-1,4
,,xeig%
"OS_ReadModeVariable",-1,5
,,yeig%
"OS_ReadModeVariable",-1,0
,,flags%
xeig%=yeig%
suffix$="22"
suffix$="24"
flags%
1<<4
suffix$="23"
=suffix$
throwback(err$,line)
"DDEUtils_ThrowbackStart"
"DDEUtils_ThrowbackSend",1,,dirname$+".!RunImage"+
0,line,2,err$+
"DDEUtils_ThrowbackEnd"
savebox(a$)
A=
A=0
nagg("There was an error. The dump could not be spritified!"):
A,B,C
openwindowxy(save%,A-96,B+64)
savefrom$=a$
savefile(a$)
copysave(a$) :
"RENAME "+savefrom$+" "+a$
copysave(a$)
nagg("Can't save as '"+a$+"'."):
"REMOVE "+savefrom$:
"Copy "+savefrom$+" "+a$+" ~C~V~R~NF"
"REMOVE "+savefrom$
loadfile(name$)
pii(save%,1,
leafname(name$))
^ cli$="/<dmp2spr$dir>.dmp2spr <angband$dir>.lib.xtra.choices <wimp$scrapdir>.Dump "+name$
"Wimp_StartTask",cli$
savebox("<wimp$scrapdir>.Dump")